package com.usermanage.Mapping;

import com.usermanage.beanParam.MessageBean;
import com.usermanage.dataDao.JpaDao;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository("messageMapping")
public interface MessageMapping extends JpaRepository<MessageBean, Integer> {

    @Query(value = "select uu.user_name from  u_user uu join u_group_member ugm on ugm.user_id=uu.id join u_group_permission upg on upg.group_id=ugm.group_id where uu.company_id = :company_id and upg.permission_id = :permission_id and uu.user_state = '11' GROUP BY uu.id",nativeQuery = true)
    List<Map> findSendeeUesrList(@Param("company_id") String company_id,@Param("permission_id") String permission_id);


}
